package com.phiture.erp.sale.web.controller.convert;

import com.phiture.erp.sale.api.pojo.resp.ErpSaleReturnResp;
import com.phiture.erp.sale.dal.entity.ErpSaleReturnDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface ErpSaleReturnConvertMapper {
    ErpSaleReturnConvertMapper INSTANCE = Mappers.getMapper(ErpSaleReturnConvertMapper.class);

    @Mappings({
            @Mapping(target = "saleReturnId", source = "id"),
            @Mapping(target = "saleReturnNo", source = "no"),
            @Mapping(target = "saleReturnStatus", source = "status")
    })
    ErpSaleReturnResp toErpSaleReturnResp(ErpSaleReturnDO saleReturnDO);
    List<ErpSaleReturnResp> toErpSaleReturnRespList(List<ErpSaleReturnDO> saleReturnDOList);
}
